UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'odP2/kJrE8Z/qRrLcSvgTbuxKpjaA465gUqtHNbzATQ=' 
WHERE 
  key_id = 'e8465d809ef570b331006ebd894afb85d592eedbf23b1666af8c3993e06ff036' 
  AND (
    token = 'odP2/kJrE8Z/qRrLcSvgTbuxKpjaA465gUqtHNbzATQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043