UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'l8cC5GlixaZ9W4+8HW+IA0P490G6N3rkwSBHCiWFOS0='
WHERE
key_id = '952b2d4699faed741d9266161db63cee5ff5c3f17e8a2b36c33df76ffe80d38a'
AND (
token = 'l8cC5GlixaZ9W4+8HW+IA0P490G6N3rkwSBHCiWFOS0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)