UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3VrnA35abIU25DHmFGuebRmy9gi2SpRXMT5Qh+65UpQ='
WHERE
key_id = 'da378ec28ea5294c307787def3e7de4023d06bad2b6c6ff924318dc4231abf34'
AND (
token = '3VrnA35abIU25DHmFGuebRmy9gi2SpRXMT5Qh+65UpQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)