UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ABV4aFWiJK2g9j9TL8XAeVZ77WUNMkoO1cER0eZz1n0='
WHERE
key_id = '736bdf3aa7294163b054baa1ba04ad8047535aa16856438cfeed82d0b4d1413c'
AND (
token = 'ABV4aFWiJK2g9j9TL8XAeVZ77WUNMkoO1cER0eZz1n0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)