UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bwBlLKaUR8GDQs3WnrTB6LOnVgucEWp8VVJJ7uWXr1U='
WHERE
key_id = '2ce0ddb4a51b68d15cabac7b90a016a6a44fd95083345a9fde3a598080bcde2a'
AND (
token = 'bwBlLKaUR8GDQs3WnrTB6LOnVgucEWp8VVJJ7uWXr1U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)