UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AelntnaM+F4fA/IAtvepF60kb0UIB8Axmhp6jPSotG0=' 
WHERE 
  key_id = 'df7586dfcd140e84037ccd02de57da0bdccc8f28f4e71f01d4e931fcb4e0625d' 
  AND (
    token = 'AelntnaM+F4fA/IAtvepF60kb0UIB8Axmhp6jPSotG0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037