UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7Y2g9D2V0DyPV32eTIz1ANzeaisk53i9A26F+EF3kLs=' 
WHERE 
  key_id = 'eb85d566822a1eea04ab8ff6209c2efd0c4a2167e0fd1a91feea4c73640359d7' 
  AND (
    token = '7Y2g9D2V0DyPV32eTIz1ANzeaisk53i9A26F+EF3kLs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00064