UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oiEz0WIJMAg5n3P3Wqk+bbE7TdordmMwMRso2B+/1JE='
WHERE
key_id = '63fc5d4ce3cfb2f7949409511c6a8ed174ded83ab984c8e06bb502188cb1f78c'
AND (
token = 'oiEz0WIJMAg5n3P3Wqk+bbE7TdordmMwMRso2B+/1JE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)