UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bfF9c+/Napgk9m8niM2otrfSUdlhRvL3PEvEiMNwJ7U='
WHERE
key_id = '5c0124be0695baddcd9698500cc68f8c261775547c2250d40a10c9bb97afca25'
AND (
token = 'bfF9c+/Napgk9m8niM2otrfSUdlhRvL3PEvEiMNwJ7U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)