UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'l4M6GOODk95vXqF3Ib0UZtAnIRGKYNst5XS771Jpn1A='
WHERE
key_id = 'a8e51eabfd8bda812af079be8e8236336b5536530dde008e7ab480b00b6fed06'
AND (
token = 'l4M6GOODk95vXqF3Ib0UZtAnIRGKYNst5XS771Jpn1A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)