UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8mvAP2iZER3NL5ZbM2cdB45LKA8VIchQk2/Hbj1B49Y=' 
WHERE 
  key_id = '93d5a91f1a78f2546cf16a8927f0512035e752ee9934fc2f0b12c0dcefe29000' 
  AND (
    token = '8mvAP2iZER3NL5ZbM2cdB45LKA8VIchQk2/Hbj1B49Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036