UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UMHjzZouk+1CQs4UlYhrj2RcqfpGLHc8Dt8l+L1+644='
WHERE
key_id = '69d1c9276c4f85009fc6e47056b7f838ce70435c8a1a2d7b555e01e92d82b18d'
AND (
token = 'UMHjzZouk+1CQs4UlYhrj2RcqfpGLHc8Dt8l+L1+644='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)