UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OBmptX2uUqlPl0l7KJ896KkIlwNii6weGGMFzTt5fJk='
WHERE
key_id = '786ad3ca72816d8a7bd4f159926892a5ad25c5f83a5b34b3e367f696f08ef9a9'
AND (
token = 'OBmptX2uUqlPl0l7KJ896KkIlwNii6weGGMFzTt5fJk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)