UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZEAXlDktU9r4f0zwKwi1UvnfjhxwfbKlITjvowvwV34='
WHERE
key_id = '31bbfeb97fd2644dbf0cb379416852008915376dcadba276a2d4526d15a010df'
AND (
token = 'ZEAXlDktU9r4f0zwKwi1UvnfjhxwfbKlITjvowvwV34='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)