UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'h1Ak+oJqcJ7ZAcmRif8KBJibP9/tAchfZ4diitfG2iE='
WHERE
key_id = '6f70f189e285ba1322c61f8e7e1ccbb08687f186e38fde8e4fa8a6af2f84ba8b'
AND (
token = 'h1Ak+oJqcJ7ZAcmRif8KBJibP9/tAchfZ4diitfG2iE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)