UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qzg2lvFOxV/HJhFPMPv6mpn/NDvIbnpifCOJD+3Vcbo=' 
WHERE 
  key_id = 'fc15d02610c94dc86c47ea5ca42f19e0df5684a7be9e8fd4fa144e15961db11e' 
  AND (
    token = 'qzg2lvFOxV/HJhFPMPv6mpn/NDvIbnpifCOJD+3Vcbo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026