UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Z3ibVYZ/l35xO/89rgK5wrJoRXMNFFM8eDB3g9N24eI='
WHERE
key_id = '663334ac1177fd79ecc56021c421e8d3de33aee9af14cf9a111c863a857f93d1'
AND (
token = 'Z3ibVYZ/l35xO/89rgK5wrJoRXMNFFM8eDB3g9N24eI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)