UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fJPJlmGCprVJeV/7FnCQoU8ESMeCKiCyZq0Lka6DqlE='
WHERE
key_id = '4d66f3cfc501bbb225536ff7725174515b0a3ce464a5f1b3f264ab1d9f5f2ab1'
AND (
token = 'fJPJlmGCprVJeV/7FnCQoU8ESMeCKiCyZq0Lka6DqlE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)