UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Qi/Yv1kpNRgpFwXvJ4awmJG2tb0Nxgc+Isb4FpfaFs4=' 
WHERE 
  key_id = 'd885b8f48e288357fe4e6fa1163976bf49b1d45819320b8d405e77cd627be4dd' 
  AND (
    token = 'Qi/Yv1kpNRgpFwXvJ4awmJG2tb0Nxgc+Isb4FpfaFs4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034