UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jHPz98B3JCXnBSXYyb04zZhiZg4kvmB+sZMce57EYFc='
WHERE
key_id = '4e40735fa300f13cd8ecfdcec92aa726bba2ca98536318242308815eb38b890b'
AND (
token = 'jHPz98B3JCXnBSXYyb04zZhiZg4kvmB+sZMce57EYFc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)