UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'm6U8ooo6JWBScfAExnRLlJo8HZxvhunXjzhK+xN1zmo='
WHERE
key_id = '70967f15ec6bd926046e5c79eb741cd49660d010cbe43d82ae6c9593f7f98cba'
AND (
token = 'm6U8ooo6JWBScfAExnRLlJo8HZxvhunXjzhK+xN1zmo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)