UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'x4QUzSdzPsM4LWw1S7EaBv+xULusBVM0A7uh8dGklMg='
WHERE
key_id = '6ccb876c86ebcdba192de10ea507c7e217061e2ab64c1faccb15eddbe53da622'
AND (
token = 'x4QUzSdzPsM4LWw1S7EaBv+xULusBVM0A7uh8dGklMg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)