UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pGNGGbu39VIdX9+uPn6Rcv6ujjaIGdEtF2SKO6iGdlM=' 
WHERE 
  key_id = '2aaecad73432bdf1384aacd5930ff269a0f28102d04bed4460b3facb578100e0' 
  AND (
    token = 'pGNGGbu39VIdX9+uPn6Rcv6ujjaIGdEtF2SKO6iGdlM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033