UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uQ+R42PsIYaGN0RgqmffOice3s4KJVH5WIbNGIz24TE='
WHERE
key_id = '68f6dd94d1b3f962d72f7cd212bf4ff71e928fcbacfb8a3232c888f4cb9dd2cc'
AND (
token = 'uQ+R42PsIYaGN0RgqmffOice3s4KJVH5WIbNGIz24TE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)