UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Zj33XcSB4lhQ1mz9n106Lbso9NBKn3WwCf1iWAGcW1o=' 
WHERE 
  key_id = '378df923365434982975d65a326c493bbfe4440ee122af0aef859ed98a757f75' 
  AND (
    token = 'Zj33XcSB4lhQ1mz9n106Lbso9NBKn3WwCf1iWAGcW1o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019