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

Query time 0.00035