UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5UR4sjz4z2AGbxoYIjKBXLsqDKwZlWjZoV9GL9ZCgAs='
WHERE
key_id = 'bcbf6bb17bdd4e1e1372183fa82bd538d048bdcb709609ecdc36a2a64216eb2b'
AND (
token = '5UR4sjz4z2AGbxoYIjKBXLsqDKwZlWjZoV9GL9ZCgAs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)