UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xBxBDa5CKzlYTGwf8PVJ/Sk1krDT5gUe/oXfca1dS40='
WHERE
key_id = '5820a7583dc50e38db7aa80e5c0b856a8c054646cea6d264613567304e507a72'
AND (
token = 'xBxBDa5CKzlYTGwf8PVJ/Sk1krDT5gUe/oXfca1dS40='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)