UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'p0aDy/CBdCy6Fd9M8ZfpMjsILMlYOX8Xr6P9sp9cYyM='
WHERE
key_id = 'a6e2fa1f6c32d9c2206203809c5886a7060de0f8c14ff4ac47cf6b22acc3a10a'
AND (
token = 'p0aDy/CBdCy6Fd9M8ZfpMjsILMlYOX8Xr6P9sp9cYyM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)