UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QnDfbAIYEBqFCGCZ3dia5nECFZDIblH8IPYrdX66/TE='
WHERE
key_id = 'fde3b4715b0e346f061645435a5c21fabe35ef6ded99e8b264b4d18c5fb298cc'
AND (
token = 'QnDfbAIYEBqFCGCZ3dia5nECFZDIblH8IPYrdX66/TE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)